﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using DTO;
using BUS;

namespace WebSieuThi.QuanLi.ThongKeAjax
{
    public partial class thongkengay : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string ngay = Request.QueryString["ngay"];
            string str = "";
            str += "<table border=\"1\">"
    + "<tr><td>Mã hàng hóa</td><td>Tên hàng hóa</td><td>Tổng doanh thu</td></tr>";

            DateTime day;
            if ((day = DateTime.Parse(ngay)) != null)
            {


                List<thongkengayResult> temp = new List<thongkengayResult>();
            temp = HoaDonBUS.LayDSTheoNgay(day);

            for (int i = 0; i < temp.Count; ++i)
            {


                str += ""
    + "<tr><td>" + temp[i].mahh + "</td><td>" + temp[i].tenhanghoa + "</td><td>" + temp[i].tong.ToString() + "</td></tr>";
       

                
            }
            str += "</table>";


            Response.Write(str);

                
            }       

            

            
        }
    }
}
